Test Post!

Test Post

Basic Markdown Functions

Text

italics

bold

~strikethrough~

links

blockquotes

Lists:

Ordered
  1. One
  2. Two
Unordered
  • Cat
  • Bat
Checkboxes
  • [x] Checkboxes
  • [ ] Theorem environments

(For some reason, as of the time of writing the checkboxes also have bullets beside them, which is not desired.)

Unicode text

μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος

οὐλομένην, ἣ μυρί᾽ Ἀχαιοῖς ἄλγε᾽ ἔθηκε,

πολλὰς δ᾽ ἰφθίμους ψυχὰς Ἄϊδι προΐαψεν

ἡρώων, αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν

5οἰωνοῖσί τε πᾶσι, Διὸς δ᾽ ἐτελείετο βουλή,

ἐξ οὗ δὴ τὰ πρῶτα διαστήτην ἐρίσαντε

Ἀτρεΐδης τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.

Images from the web

Mathematics

The flavor of Markdown I'm using supports $\LaTeX$ typesetting of mathematics via MathJax.

For instance, here are Maxwell's equations:

\begin{align} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{align}

It doesn't seem to support theorem environments, alas.

Python code

In [1]:
# a comment

import pandas as pd
import numpy as np
import plotly.express as px
import plotly.graph_objects as go 
from urllib.request import urlopen
import json

Data frames

In [2]:
df = px.data.iris()
df
Out[2]:
sepal_length sepal_width petal_length petal_width species species_id
0 5.1 3.5 1.4 0.2 setosa 1
1 4.9 3.0 1.4 0.2 setosa 1
2 4.7 3.2 1.3 0.2 setosa 1
3 4.6 3.1 1.5 0.2 setosa 1
4 5.0 3.6 1.4 0.2 setosa 1
... ... ... ... ... ... ...
145 6.7 3.0 5.2 2.3 virginica 3
146 6.3 2.5 5.0 1.9 virginica 3
147 6.5 3.0 5.2 2.0 virginica 3
148 6.2 3.4 5.4 2.3 virginica 3
149 5.9 3.0 5.1 1.8 virginica 3

150 rows × 6 columns

Charts and Graphs

Line Charts

I'm using Plot.ly for my graphing, because it offers an intuitive, easy-to-use API and because it supports interactive visualizations.

In [3]:
# example graph using the Iris dataset
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", marginal_y="violin",
           marginal_x="box", trendline="ols", template="simple_white")
fig.show()

Scatterplots

In [4]:
# the same dataset in 3d

fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',
              color='species')
fig.show()

Area charts

Another example visualizing topographical data with a color scheme.

In [6]:
# 3D surface example plot from the plotly docs
# Read data from a csv
z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')

fig = go.Figure(data=[go.Surface(z=z_data.values)])

fig.update_layout(title='Mt Bruno Elevation', autosize=False,
                  width=500, height=500,
                  margin=dict(l=65, r=50, b=65, t=90))

fig.show()

Geodata visualizations

Another cool chloropleth example from the docs that utilizes GeoJSON to visualize the unemployment rate in the US by county.

In [7]:
with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:
    counties = json.load(response)


df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv",
                   dtype={"fips": str})

fig = px.choropleth_mapbox(df, geojson=counties, locations='fips', color='unemp',
                           color_continuous_scale="Viridis",
                           range_color=(0, 12),
                           mapbox_style="carto-positron",
                           zoom=3, center = {"lat": 37.0902, "lon": -95.7129},
                           opacity=0.5,
                           labels={'unemp':'unemployment rate'}
                          )
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()